const koa = require("koa");
const app = new koa();

app.use(async (ctx, next) => {
  const start = Date.now();
  await next();
  const end = Date.now();
  console.log(`请求 ${ctx.url} 耗时 ${end - start} ms`);
  
});

app.use((ctx, next) => {
  ctx.body = [{
    name: "Tom",
    age: 18,
    sex: '女'
  }]
});

app.listen(3000);
